package cn.schoolwow.workflow.module.instance.query.kit;

import cn.schoolwow.quickdao.domain.database.dql.response.PageVo;
import cn.schoolwow.workflow.domain.instance.InstanceContextDataRequest;
import cn.schoolwow.workflow.domain.instance.WorkFlowInstanceQuery;
import cn.schoolwow.workflow.entity.WorkFlowInstance;
import cn.schoolwow.workflow.entity.WorkFlowInstanceHistory;
import com.alibaba.fastjson.JSONObject;

import java.util.List;

public interface WorkFlowInstanceQueryService {
    /**
     * 查询工作流实例个数
     * */
    long getWorkFlowInstanceCount(WorkFlowInstanceQuery workFlowInstanceQuery);

    /**
     * 查询单个工作流实例
     * @param workFlowInstanceId 工作流实例id
     * */
    WorkFlowInstance getSingleWorkFlowInstance(Long workFlowInstanceId);

    /**
     * 查询单个工作流实例
     * */
    WorkFlowInstance getSingleWorkFlowInstance(WorkFlowInstanceQuery workFlowInstanceQuery);

    /**
     * 分页查询工作流实例
     * */
    PageVo<WorkFlowInstance> getWorkFlowInstancePagingList(WorkFlowInstanceQuery workFlowInstanceQuery, int pageNumber, int pageSize);

    /**
     * 查询工作流实例
     * */
    List<WorkFlowInstance> getWorkFlowInstanceList(WorkFlowInstanceQuery workFlowInstanceQuery);

    /**
     * 查询工作流实例上下文数据
     * @param workFlowInstanceId 工作流实例id
     * */
    JSONObject getWorkFlowInstanceContextData(Long workFlowInstanceId);

    /**
     * 查询工作流实例上下文数据
     * @param contextDataRequest 查询请求
     * */
    JSONObject getWorkFlowInstanceContextData(InstanceContextDataRequest contextDataRequest);

    /**
     * 查询工作流实例历史操作记录
     * @param workFlowInstanceQuery 查询请求
     * */
    List<WorkFlowInstanceHistory> getWorkFlowInstanceHistoryList(WorkFlowInstanceQuery workFlowInstanceQuery);

}
